﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using ESOL.Business.Mst;
using ESOL.Common.Entity;

namespace ESOL.WinUI.Inv
{
    public partial class frmPrintTemplateInvDispatchOrder : DevExpress.XtraReports.UI.XtraReport
    {
        public frmPrintTemplateInvDispatchOrder(DataRow drOrder, DataTable dtOrderDetail)
        {
            InitializeComponent();
            this.DataSource = dtOrderDetail;
            labOrderCode.Text = drOrder["ORDER_CODE"].ToString();
            MstCommonItemEntity mDispatchTypeEntity = MstCommonItemBs.GetMstCommonItemByCode(drOrder["ORDER_TYPE"].ToString());
            labDispatchType.Text = mDispatchTypeEntity.ItemName;
            labRequestDate.Text = drOrder["ORDER_DATE"].ToString();
            balRequestPerson.Text = drOrder["NAME_CN_ORDER"].ToString();
            labApprovePerson.Text = drOrder["NAME_CN_APPROVED"].ToString();
            labApproveDate.Text = drOrder["APPROVED_DATE"].ToString();
            MstCommonItemEntity mStatusEntity = MstCommonItemBs.GetMstCommonItemByCode(drOrder["STATUS"].ToString());
            labOrderStatus.Text = mStatusEntity.ItemName;
            labRemark.Text = drOrder["REMARK"].ToString();

            xrtProductCode.DataBindings.Add("Text", dtOrderDetail, "PRODUCT_CODE");
            xrtProductName.DataBindings.Add("Text", dtOrderDetail, "PRODUCT_NAME");
            xrtDescription.DataBindings.Add("Text", dtOrderDetail, "PRODUCT_NAME");
            xrtQty.DataBindings.Add("Text", dtOrderDetail, "QTY");
            xrtMasterUnit.DataBindings.Add("Text", dtOrderDetail, "UNIT");
            xrtSecondUnit.DataBindings.Add("Text", dtOrderDetail, "MINOR_UNIT");
            xrtWarehouseName.DataBindings.Add("Text", dtOrderDetail, "WAREHOUSE_NAME");
            xrtLocation.DataBindings.Add("Text", dtOrderDetail, "LOCATION_CODE");
            xrtRemark.DataBindings.Add("Text", dtOrderDetail, "REMARK");
        }
    }
}
